package com.dq.validator;

import com.dq.exception.customException.AdminException;
import org.apache.commons.lang3.StringUtils;

/**
 * 数据校验
 * @author gewenzhen 
 */
public abstract class Assert {

    public static void isBlank(String str, String message) throws AdminException {
        if (StringUtils.isBlank(str)) {
            throw new AdminException(message);
        }
    }

    public static void isNull(Object object, String message) throws AdminException {
        if (object == null) {
            throw new AdminException(message);
        }
    }
    public static void isEquals(String one, String two, String message) throws AdminException {
        if (one.equals(two)) {
            throw new AdminException(message);
        }
    }
    public static void isNoEquals(String one, String two, String message) throws AdminException {
        if (!one.equals(two)) {
            throw new AdminException(message);
        }
    }
}
